package com.itheima.a01abstractdemo01;

/***
 *@title Person
 *@description <TODO description class purpose>
 *@author 12468
 *@version 1.0.0
 *@create 2024/10/28 21:55
 **/
public abstract class Person {

    private String name;
    private int age;

    // 抽象类构造函数的作用：当创建子类的时候，给属性赋值的
    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public abstract void work();

    public void sleep() {
        System.out.println("睡觉");
    }

}
